package utils;

public class SortUtils {
    public static final String FILE_PREFIX = "../dataset/";

    // 验证数组排序是否正确
    public static void validate(int[] arr) {
        boolean flag = true;
        int i = 0;
        for (; i < arr.length - 1; i++) {
            if (arr[i] > arr[i + 1]) {
                flag = false;
                break;
            }
        }
        if (flag) {
            System.out.println("排序正确");
        } else {
            System.out.println("排序错误：arr[" + i + "]=" + arr[i] + ",arr[" + (++i) + "]=" + arr[i]);
        }

    }
}
